<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type='text/css'>
	table.left{
		border: 1px solid #ffffff; /*굵기 스타일 색상*/
		min-width: 10px;
		padding: 0px;
	}
   img{
   		border:0;
   	} 
  .id_blur {
        background: transparent url("img/login_bg-znmee.gif") top left
   }
  .id_focus { 
        background: #ffffe0 ; 
        color: #003300 
   }
  .pw_blur { 
        background: transparent url("img/login_bg-znmee.gif") bottom left
  }
  .pw_focus { 
        background: #ffffe0 ; 
        color: #003300 
  }
  ul { 
        list-style:none;    
        margin:0;    
        padding:0;
  } 
  li {    
        margin: 0 ;    
        padding: 0 ;    
        border : 0;    
        float: left; 
        font-size: 12px;
  }
  .member_join {
        color:gray;
  }
  .common{
        color:gray;
   }
 </style>
 <script type="text/javascript">
 	function loginBtn(){
 		var f = document.form;
 		if(f.member_id.value==""){
 			alert("이름을 입력하세요.");
 			f.member_id.focus();
 			return;
 		}
 		var num = document.all.gender.length;
 		for(var i =0 ; i < num; i++){
 			if(document.all.gender[i].checked ==true){
 				break;
 			}
 			if((i+1) == num){
 	 			alert("성별을 선택해주세요.");
 	 			return;
 	 		}
 		}
 		var flag = true;
 		if(!f.email.value){
 			flag = false;
 		}
 		
 		if(flag){
 			if(!f.email_type.value){
 				alert("메일 타입을 작성해주세요.");
 				f.email_type.focus();
 				return;
 			}
	 		f.submit();
 		}else{
 			if(confirm("이메일을 작성하시면 추후 검사 결과를 이메일로 받아 볼수 있습니다. 메일을 작성없이 검사를 하시겠습니까? ")){
				f.submit();			 				
 			}
 		}
 	}
 	
 	function test(){
 		alert("탈퇴 따윈 없다.");
 	}
 	
 	function test1(){
 		alert("수정 따윈 없어");
 	}
 </script>
	<form method="post" name="form" action="memberLogin.do" >
		<c:choose>
			<c:when test="${null eq login_info }">
				<table align="left" class="left">
					<tr>
						<td align="left">
							<input type="text" name="member_id" onfocus="this.className='id_focus'" onblur="if (this.value==''){this.className='id_blur'}" class="id_blur" size="19">
						</td>
						<td rowspan="2">
							<img  src="img/btn_login4.gif" onclick="loginBtn()" style="cursor:pointer;">
						</td>
					</tr>
					<tr>
						<td align="left">
						 	<input type="text" name="email" onfocus="this.className='pw_focus'" onblur="if(this.value==''){this.className='pw_blur'}" class="pw_blur">
						 	<br>@<input type="text" name="email_type">
						</td>
					</tr>
					<tr>
						<td align="left">
							<input id="m" type="radio" name="gender"  value="M" style="cursor: pointer;"><label for="m" style="cursor: pointer;">남</label> <input id="f" type="radio" name="gender" value="F" style="cursor: pointer;"><label for="f" style="cursor: pointer;">여</label> 
						</td>
					</tr>
				</table>
			</c:when>
			<c:otherwise>
				${login_info.member_id}님 &nbsp;&nbsp;
				<br>
				<a href="loginOut.do">로그아웃</a>
			</c:otherwise>
		</c:choose>
	</form>
